package com.diycode.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.diycode.utils.Entity;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Time;

/**
 * <p>
 * 
 * </p>
 *
 * @author diycode
 * @since 2024-04-17
 */
public class Tickets extends Entity {

    private static final long serialVersionUID = 1L;

    @TableId(type= IdType.AUTO)
    private Integer ticketID;

    private Integer trainID;

    private String startStation;

    private String endStation;
    @JsonFormat(pattern = "HH:mm:ss",timezone = "GMT+8")
    private Time startTime;
    @JsonFormat(pattern = "HH:mm:ss",timezone = "GMT+8")
    private Time endTime;

    private BigDecimal price;

    @TableField(exist = false)
    private String trainNumber;

    public Integer getTicketID() {
        return ticketID;
    }

    public void setTicketID(Integer ticketID) {
        this.ticketID = ticketID;
    }

    public Integer getTrainID() {
        return trainID;
    }

    public void setTrainID(Integer trainID) {
        this.trainID = trainID;
    }

    public String getStartStation() {
        return startStation;
    }

    public void setStartStation(String startStation) {
        this.startStation = startStation;
    }

    public String getEndStation() {
        return endStation;
    }

    public void setEndStation(String endStation) {
        this.endStation = endStation;
    }

    public Time getStartTime() {
        return startTime;
    }

    public void setStartTime(Time startTime) {
        this.startTime = startTime;
    }

    public Time getEndTime() {
        return endTime;
    }

    public void setEndTime(Time endTime) {
        this.endTime = endTime;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getTrainNumber() {
        return trainNumber;
    }

    public void setTrainNumber(String trainNumber) {
        this.trainNumber = trainNumber;
    }

    @Override
    public String toString() {
        return "Tickets{" +
            "ticketID = " + ticketID +
            ", trainID = " + trainID +
            ", startStation = " + startStation +
            ", endStation = " + endStation +
            ", startTime = " + startTime +
            ", endTime = " + endTime +
            ", price = " + price +
        "}";
    }
}
